//用户接口相关的函数
import request from "../../utils/request"


//用户回收站列表
export const userRecyclesList = (params) => {
  return request.get("/api/users/recycle", { params })
}
//成员库(用户列表)
export const users = (params) => {
  return request.get("/api/users/index", { params })
}
//搜索用户
export const Searchusers = (params) => {
  return request.get("/api/users/search_users", { params })
}
//用户启用和禁用
export const userStatus = (data) => {
  return request.post("api/organized/update_user_status",(data))
}
//获取用户的树状关系图
export const usersTree = (params) => {
  return request.get("/api/users/tree_relation_map", { params })
}
//查询单个成员
export const usersQuery = (params) => {
  return request.get("/api/users/show" , {params})
}
//查询单个成员的公司和角色（树状）
export const userRelation = (params) => {
  return request.get("/api/users/user_with_relation", { params })
}
//软删除成员
export const usersdel = (data) => {
  return request.post("/api/users/destroy", data)
}
//永久删除成员
export const userdelete = (data) => {
  return request.post("/api/users/delete", data)
}
//角色列表
export const roleList = (params) => {
  return request.get("/api/roles", { params })
}
//批量永久删除成员
export const deleteMore = (data) => {
  return request.post("/api/users/deleteMore",data)
}

//批量软删除成员列表
export const destroyMore = (data) => {
  return request.post("/api/users/destroyMore", data)
}
//恢复某个成员
export const retrieve = (data) => {
  return request.post("/api/users/retrieve", data)
}
//编辑修改单个成员
export const usersModify = (data) => {
  return request.post("/api/users/update", data)
}

//手机号搜索
export const GetOne = (params) => {
  return request.get("api/users/get_user_by_phone", {params})
}
//手机号找用户
export const AddOne = (data) => {
  return request.post("api/organized/add_one_user", data)
}
//恢复某些成员
export const retrieveMore = (data) => {
  return request.post("/api/users/retrieveMore", data)
}
//成员导入
/* export const Userimport = (data) => {
  return request.post("/api/users/import", data)
} */
//成员导出
export const Userexport = (params) => {
  return request.get("/api/users/export", { params })
}
export const exportExcel = (data) => {
  return axios({
      url: `/api/users/export`,
      method: 'get',
      data,
      'responseType':"blob" 
  })
}
